var express = require('express');
var router = express.Router();

router
    .get('/set', function (req, res, next) {
        // res.end('hello session');
        req.session.data = {
            message: 'hello session',
        }

        req.session.save(function (err) {
            if (err) return res.json({ data: '服务器错误' });
            res.json({ data: 'session设置成功' });
        })
    })
    .get('/get', function (req, res, next) {
        res.json(req.session.data);
    })




module.exports = router;